package method.method1202;
//挑出数组中最大和最小值
public class arr02 {
    public static void main(String[] args) {
        int[] arr=new int[]{10,50,90,60,80};
        int max=arr[0];
        int min=arr[0];
        for (int i = 1;
             i < arr.length;
             i++) {
            max=max>arr[i]?max:arr[i];
            min=min>arr[i]?arr[i]:min;
        }
        System.out.println("最大值是："+max);
        System.out.println("最小值是："+min);
    }


}
